<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>红包活动列表-编辑红包活动</title>
<link href="/electriccar/Public/admin/css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="/electriccar/Public/admin/js/jquery.js"></script>

<link href="/electriccar/Public/validform/Validform.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/electriccar/Public/validform/Validform_v5.3.2.js"></script>
<script type="text/javascript" src="/electriccar/Public/validform/Validform_Datatype.js"></script>

<link href="/electriccar/Public/admin/css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/electriccar/Public/admin/js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="/electriccar/Public/admin/js/select-ui.min.js"></script>

<script type="text/javascript" src="/electriccar/Public/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
    $("#red_type").uedSelect({
		width : 150			  
	});
});

//营销型红包展示更多选项
function showmore(v){
	if(v=="3"){
		$("[id^='more_li_']").show();
		$("#red_count").val("");
		$("#red_money").val("");
	}else{
		$("[id^='more_li_']").hide();
		$("#red_count").val("0");
		$("#red_money").val("0");
	}
}
</script>
</head>

<body>

	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="<?php echo U('index/index');?>">首页</a></li>
			<li><a href="<?php echo U('redpacket/index');?>">红包活动列表</a></li>
			<li><a href="#">编辑红包活动</a></li>
		</ul>
    </div>
    
    <div class="formbody">
    
		<div class="formtitle"><span>编辑红包活动</span></div>

		<form name="myform" id="myform" action="<?php echo U('redpacket/editredpacket',array('red_id'=>$redpacketinfo['red_id']));?>" method="post">
			<ul class="forminfo">
				<li><label>红包名称</label><input name="info[red_title]" id="red_title" type="text" class="dfinput" datatype="s5-15" errormsg="红包名称范围在5~15位之间！" maxlength="20" value="<?php echo ($redpacketinfo["red_title"]); ?>" /><i class="Validform_checktip"></i></li>
				<li><label>活动类型</label>
					<div class="vocation">
						<select id="red_type" name="info[red_type]" datatype="*" errormsg="活动类型不能为空！" onchange="showmore(this.value);">
							<option value="">请选择类型</option>
							<?php if(is_array($redtype)): $i = 0; $__LIST__ = $redtype;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($key); ?>" <?php if($key == $redpacketinfo["red_type"] ): ?>selected<?php endif; ?>><?php echo ($data); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
						</select>
					</div>
					<i class="Validform_checktip"></i>
				</li>
				
				<li id="more_li_0" <?php if($redpacketinfo["red_type"] != 3 ): ?>style="display:none;"<?php endif; ?>><label>红包数量</label><input name="info[red_count]" id="red_count" type="text" class="dfinput" value="<?php echo ($redpacketinfo["red_count"]); ?>" datatype="n1-3" errormsg="红包数量不能为空（1-3位）！" maxlength="5" /><i class="Validform_checktip"></i></li>
				<li id="more_li_1" <?php if($redpacketinfo["red_type"] != 3 ): ?>style="display:none;"<?php endif; ?>><label>红包总金额</label><input name="info[red_money]" id="red_money" type="text" class="dfinput" value="<?php echo ($redpacketinfo["red_money"]); ?>" datatype="/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/" errormsg="红包总金额不能为空，且为小数（1-8位）！" maxlength="8" /><i class="Validform_checktip"></i></li>

				<li><label>红包范围</label>
					<input name="info[red_min]" id="red_min" type="text" class="dfinput" value="<?php echo ($redpacketinfo["red_min"]); ?>" datatype="/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/" errormsg="红包范围小值不能为空，且为小数（1-5位）！" maxlength="5" style="width: 170px;" maxlength="5" />-
					<input name="info[red_max]" id="red_max" type="text" class="dfinput" value="<?php echo ($redpacketinfo["red_max"]); ?>" datatype="/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/" errormsg="红包范围大值不能为空，且为小数（1-5位）！" maxlength="5" style="width: 170px;" maxlength="5" />
					<i class="Validform_checktip"></i></li>
				<li><label>时间范围</label>
					<input name="info[red_starttime]" id="red_starttime" class="dfinput" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{ $dp.$D(\'red_endtime\')||\'2100-10-01\' }'})" datatype="*" errormsg="时间范围开始值不能为空！" maxlength="20" style="width: 170px;" readonly value="<?php echo ($redpacketinfo["red_starttime"]); ?>" />-
					<input name="info[red_endtime]" id="red_endtime" class="dfinput" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{ $dp.$D(\'red_starttime\') }',maxDate:'2100-10-01'})" datatype="*" errormsg="时间范围结束值范围不能为空！" maxlength="20" style="width: 170px;" readonly value="<?php echo ($redpacketinfo["red_endtime"]); ?>" />
					<i class="Validform_checktip"></i></li>

				<li><label>&nbsp;</label><input name="btn" type="submit" class="btn" value="确认保存"/></li>
			</ul>
		</form>
    
    </div>

	<script>
	$(function(){
		$("#myform").Validform({
			//tiptype:2
			tiptype:function(msg,o,cssctl){
				var objtip=o.obj.siblings(".Validform_checktip");
				cssctl(objtip,o.type);
				objtip.text(msg);
			}
		});
	}); 
	</script>
</body>

</html>